package com.gao.api.gate.quick.proto.config;

/**
 * <p></p>
 *
 * @author gaoshuangwen
 * @since 2022/01/17 15:27
 */
public class TcpConfig {
    private final boolean tcpNoDelay;
    private final boolean soReuseAddress;
    private final boolean soKeepAlive;
    private final int soLinger;
    private final int soSndBuf;
    private final int soRcvBuf;

    public TcpConfig(boolean tcpNoDelay, boolean soReuseAddress,
                     boolean soKeepAlive, int soLinger, int soSndBuf, int soRcvBuf) {
        this.tcpNoDelay = tcpNoDelay;
        this.soReuseAddress = soReuseAddress;
        this.soKeepAlive = soKeepAlive;
        this.soLinger = soLinger;
        this.soSndBuf = soSndBuf;
        this.soRcvBuf = soRcvBuf;
    }

    public boolean isTcpNoDelay() {
        return tcpNoDelay;
    }

    public boolean isSoReuseAddress() {
        return soReuseAddress;
    }

    public boolean isSoKeepAlive() {
        return soKeepAlive;
    }

    public int getSoLinger() {
        return soLinger;
    }

    public int getSoSndBuf() {
        return soSndBuf;
    }

    public int getSoRcvBuf() {
        return soRcvBuf;
    }
}
